import request from '../../../utils/request'

export function listPost (query) {
  return request({
    url: '/system/post/listPost',
    method: 'get',
    data: query
  })
}
// 查询岗位详细
export function getPostById (postId) {
  return request({
    url: '/system/post/getPostById?id=' + postId,
    method: 'get'
  })
}
// 新增岗位
export function addPost (data) {
  return request({
    url: '/system/post/addPost',
    method: 'post',
    data: data
  })
}
// 修改岗位
export function updatePost (data) {
  return request({
    url: '/system/post/updatePost',
    method: 'post',
    data: data
  })
}
// 删除岗位
export function delPost (postId) {
  let postIds = []
  if (!Array.isArray(postId)) {
    postIds.push(postId)
  } else {
    postIds = postId
  }
  return request({
    url: '/system/post/deletePost',
    method: 'delete',
    data: postIds
  })
}
// 导出岗位
export function exportPost (query) {
  return request({
    url: '/system/post/deletePost',
    method: 'delete',
    data: query
  })
}
